package zbg.uiil;

import javax.servlet.http.Cookie;

/**
 * @program: servlet
 * @description:
 * @author: Dawson.Zhang
 * @create: 2020-03-15
 **/
public class CookieUtils {
    public static Cookie findCookie(String name, Cookie[] cookie) {
        if (name == null || cookie.length == 0 || cookie == null) {

            return null;
        }
        for (Cookie cookie1 : cookie) {
            if (name.equals(cookie1.getName())){
                return cookie1;
            }
        }
        return null;
    }
}
